/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ejemplo.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author carlosdavid
 */
@Entity
@Table(name = "sede", catalog = "base_produccion", schema = "")
@NamedQueries({
    @NamedQuery(name = "Sede.findAll", query = "SELECT s FROM Sede s"),
    @NamedQuery(name = "Sede.findByCodsede", query = "SELECT s FROM Sede s WHERE s.codsede = :codsede"),
    @NamedQuery(name = "Sede.findBySede", query = "SELECT s FROM Sede s WHERE s.sede = :sede")})
public class Sede implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "codsede", nullable = false)
    private Integer codsede;
    @Column(name = "sede", length = 255)
    private String sede;
    @OneToMany(mappedBy = "codsede")
    private List<Usuario> usuarioList;

    public Sede() {
    }

    public Sede(Integer codsede) {
        this.codsede = codsede;
    }

    public Integer getCodsede() {
        return codsede;
    }

    public void setCodsede(Integer codsede) {
        this.codsede = codsede;
    }

    public String getSede() {
        return sede;
    }

    public void setSede(String sede) {
        this.sede = sede;
    }

    public List<Usuario> getUsuarioList() {
        return usuarioList;
    }

    public void setUsuarioList(List<Usuario> usuarioList) {
        this.usuarioList = usuarioList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codsede != null ? codsede.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sede)) {
            return false;
        }
        Sede other = (Sede) object;
        if ((this.codsede == null && other.codsede != null) || (this.codsede != null && !this.codsede.equals(other.codsede))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ejemplo.entity.Sede[ codsede=" + codsede + " ]";
    }
    
}
